# coding:utf8
import time
import urllib.request
from ZGWKDownload import ZGWKDownload
from bs4 import BeautifulSoup
#简单（静态页面）爬虫1
if __name__ == '__main__':


    url = "http://shop.99114.com/list/area/101102_4"
    header = {
       'Accept': 'text / html, application / xhtml + xml, application / xml;q = 0.9, image / webp, image / apng, * / *;q = 0.8',
        'Host': 'shop.99114.com',
       'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.26 Safari/537.36 Core/1.63.6756.400 QQBrowser/10.3.2565.400'
    }
    request = urllib.request.Request(url,headers=header)
    response1 = urllib.request.urlopen(request)
    # print(response1.read())
    suop = BeautifulSoup(response1,'html.parser',from_encoding='utf-8')
    strs = suop.find_all('li')
    response1.close()
    # print(strs)
    #
    for str in strs:
        all = str.find_all('a')
        for a in all:
            # print(a['href'])
            time.sleep(21)
            download = ZGWKDownload();
            download.domnload(a['href'])


